home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 2
/
Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso
/
Aminet
/
util
/
gnu
/
textutils_1_3.LHA
/
textutils-1.3
/
lib
/
memchr.c
< prev
next >
Wrap
Text File
|
1992-06-29
|
391b
|
20 lines
/* memchr.c -- compare memory.
Return address of first C in S, or NULL if not found.
Stops looking after N characters. Doesn't stop at nulls.
In the public domain.
By David MacKenzie <djm@ai.mit.edu>. */
char *
memchr (s, c, n)
register char *s;
register char c;
register unsigned n;
{
while (n--)
{
if (*s++ == c)
return s - 1;
}
return 0;
}